<template>
  <div>
    <van-goods-action>
      <van-goods-action-icon 
        :icon="isCollected?'star':'star-o'" 
        :text="isCollected?'已收藏':'未收藏'" 
        :color="isCollected?'#ff5000':'#666'" 
        @click="hdChanisCollected"/>
      <van-goods-action-icon icon="cart-o" text="购物车" :badge="goodsCount" @click="$router.push('/cart')"/>
      <van-goods-action-button type="danger" text="立即购买" />
      <van-goods-action-button type="warning" text="加入购物车" @click="toAddCart"/>
      
    </van-goods-action>
  </div>
</template>

<script>
export default {
  props:["goodsCount","isCollected"],
  data () {
    return {
    }
  },
  methods:{
    // 点击 打开/关闭 选择商品数量
    toAddCart(){
      this.$emit("showSku")
    },
    hdChanisCollected(){
      this.$emit('hdChanisCollected')
    }
  }
}
</script>
 
<style lang = "less" scoped>
  .van-goods-action{
    z-index:9999;
  }
</style>